<?php

/*
	QscTech @ Fcten
	Update Time: 2010-03-04
*/

!defined('IN_UC') && exit('Access Denied');

class permissioncontrol extends base {


	function __construct() {
		$this->permissioncontrol();
	}

	function permissioncontrol() {
		parent::__construct();
		$this->load('permission');
		$this->app = $this->cache['apps'][UC_APPID];
	}

	function onadd() {
		$this->init_input();
		$uid = intval( $this->input('uid') );
		$permission = $this->input('permission');

		return $_ENV['permission']->add($uid, $permission);
	}

	function onsub() {
		$this->init_input();
		$uid = intval( $this->input('uid') );
		$permission = $this->input('permission');

		return $_ENV['permission']->sub($uid, $permission);
	}

	function onreg() {
		$this->init_input();
		$permission = $this->input('permission');

		return $_ENV['permission']->reg($permission);
	}

	function ondel() {
		$this->init_input();
		$permission = $this->input('permission');

		return $_ENV['permission']->del($permission);
	}

	function oncheck() {
		$this->init_input();
		$uid = intval( $this->input('uid') );
		$permission = $this->input('permission');

		return $_ENV['permission']->check($uid, $permission);
	}

}

?>
